[mirrors]
http://ftp.gnu.org/gnu/coreutils/coreutils-8.20.tar.xz
[vars]
filesize=5273788
sha512=adbeab5af780ae70d2a98a81e96ad2cdfbcbc20153372b0085f6ac75ae9fadff82bd09b460400820057692b4145d7f2d276630b76b0ed509303587972ed175cd

[deps.host]
dynamic-toolchain

[build]
patch -p1 < "$K"/coreutils-xcompile.patch
# by default gnulib builds 230 of 389 C-files.
GNULIB_CPPFLAGS=$("$K"/gnulibfix lib)
dir=$PWD
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
FORCE_UNSAFE_CONFIGURE=1 \
CFLAGS="-D_GNU_SOURCE -I $dir $GNULIB_CPPFLAGS" \
./configure -C --prefix="$butch_prefix" \
  gl_cv_func_working_mktime=yes gl_cv_func_linkat_follow=yes gl_cv_func_mknod_works=yes \
  gl_cv_func_getgroups_works=yes $xconfflags

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
